package com.mtao.impl;

import com.mtao.SysRoleMenuService;
import com.mtao.mapper.SysRoleMenuMapper;
import com.mtao.entity.SysRoleMenu;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRoleMenuServiceImpl implements SysRoleMenuService {

    @Resource
    private SysRoleMenuMapper sysRoleMenuMapper;
    /**
     * 批量添加
     * @param sysRoleMenus
     */
    @Override
    public void batchAddRoleMenu(List<SysRoleMenu> sysRoleMenus) {
        sysRoleMenuMapper.addRoleMenu(sysRoleMenus);
    }

    /**
     * 根据角色id获取菜单
     * @param roleId
     * @return
     */
    @Override
    public List<SysRoleMenu> getRoleMenu(Integer roleId) {
        List<SysRoleMenu> roleMenu = sysRoleMenuMapper.getRoleMenu(roleId);
        return roleMenu;
    }

    /**
     * 根据角色id删除菜单
     * @param rolesId
     */
    @Override
    public void batchDeleteRoleMenu(Integer rolesId) {
        sysRoleMenuMapper.batchDeleteRoleMenu(rolesId);
    }
}
